package com.dataStructure.哈希表;

import com.dataStructure.model.Person;
import org.junit.jupiter.api.Test;

public class HashTest {
    @Test
    public void test1(){
        //根据 IEEE 754 浮点“单一格式”位布局，返回指定浮点值的表示形式。
        //计算出浮点数在内存中存储的010101..对应的整数值。
        System.out.println(Float.floatToIntBits(12.3f));
        System.out.println(Integer.toBinaryString(123));
        //float在内存中的存储方式
        Integer.toBinaryString(Float.floatToIntBits(12.3f));
    }

    @Test
    public void test2(){
        long l = System.currentTimeMillis();
        int i = 31 * 13213131;
        long l1 = System.currentTimeMillis();
        System.out.println(l1 - l);
        long l2 = System.currentTimeMillis();
        int i1 = 32 * 13213131;
        long l3 = System.currentTimeMillis();
        System.out.println(l3 - l2);
    }

    @Test
    public void test3 (){
        Person p = new Person(10,"doubleKill");
        Person p1 = new Person(10,"doubleKill");
        System.out.println( p.hashCode()== p1.hashCode());
    }

    @Test
    public void test4 (){
        计算哈希值 计算哈希值 = new 计算哈希值();
        System.out.println(计算哈希值.calculationStringHash("通话"));
        System.out.println(计算哈希值.calculationStringHash("重地"));
    }
}
